﻿#include "mainwindow.h"
#include "database.h"
#include <QApplication>
#include "login.h"
#include "mainwindow.h"
#include <QDebug>
#include "cdatabaseinterface.h"
#include <QMessageBox>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    //数据库读取
    if(!CDatabaseInterface::getInstance()->openDB("./data.db","QSQLITE"))
        qDebug()<<"data.db open failed!";

    login m_login;
    m_login.exec();
    MainWindow  m_mainwindow;
    if(m_login.isFunctionCall() == true)
    {
        m_mainwindow.show();
    }
    m_mainwindow.show();
//    else
//        return 0;

    /***
    QFile file("./DependFile/QSS/radioButtonStyle.txt");
    if(file.open(QFile::ReadOnly))
    {
        QString styleSheet = QLatin1String(file.readAll());
        m_mainwindow.setStyleSheet(styleSheet);
        file.close();
    }
    else
    {
        QMessageBox::warning(NULL, "warning", "Open failed", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
    }
    ***/
    return a.exec();

}
